/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.edu.nju.software.greencreditsystem.action;

import cn.edu.nju.software.greencreditsystem.domain.EnvironmentWarning;
import cn.edu.nju.software.greencreditsystem.domain.FinancialWarning;
import cn.edu.nju.software.greencreditsystem.domain.Prediction;
import cn.edu.nju.software.greencreditsystem.factory.ServiceFactory;
import cn.edu.nju.software.greencreditsystem.service.EnvironmentExcelService;
import cn.edu.nju.software.greencreditsystem.service.FinancialExcelService;
import cn.edu.nju.software.greencreditsystem.service.PredictionService;
import cn.edu.nju.software.greencreditsystem.service.WarningService;
import com.opensymphony.xwork2.ActionSupport;
import java.util.List;

/**
 * 作者：韩天
 * 创建时间：2011-8-13
 * 类描述：银行登录模块的action封装类
 */
public class BankLoginAction extends ActionSupport {
    private int uncheckedEnvironment;//待审核社会环境报表数
    private int uncheckedFinancial;//待审核财务报表
    private List<FinancialWarning> fwarningList;//财务警告列表
    private List<EnvironmentWarning> ewarningList;//环境警告列表
    private List<Prediction> predictionList;//财务预警列表
    
    @Override
    /**
     * 方法描述：默认的执行方法，实现无条件跳转
     * param：
     * return：SUCCESS
     */
    public String execute() {
        return SUCCESS;
    }
    
    /**
     * 方法描述：登录
     * param：
     * return：SUCCESS
     */
    public String login() {
        FinancialExcelService fes = ServiceFactory.getFinancialExcelServiceInstance();
        this.uncheckedFinancial = fes.getUnckeckedExcelCount();
        EnvironmentExcelService ees = ServiceFactory.getEnvironmentExcelServiceInstance();
        this.uncheckedEnvironment = ees.getUnckeckedExcelCount();
        WarningService ws = ServiceFactory.getWarningServiceInstance();
        this.fwarningList = ws.get_TwoFinancialWarning();
        this.ewarningList = ws.get_TwoEnvironmentWarning();
        PredictionService ps = ServiceFactory.getPredictionServiceInstance();
        this.predictionList = ps.get_TwoPrediction();
        
        return SUCCESS;
    }
    
    

    public int getUncheckedEnvironment() {
        return uncheckedEnvironment;
    }

    public void setUncheckedEnvironment(int uncheckedEnvironment) {
        this.uncheckedEnvironment = uncheckedEnvironment;
    }

    public int getUncheckedFinancial() {
        return uncheckedFinancial;
    }

    public void setUncheckedFinancial(int uncheckedFinancial) {
        this.uncheckedFinancial = uncheckedFinancial;
    }

    public List<EnvironmentWarning> getEwarningList() {
        return ewarningList;
    }

    public void setEwarningList(List<EnvironmentWarning> ewarningList) {
        this.ewarningList = ewarningList;
    }

    public List<FinancialWarning> getFwarningList() {
        return fwarningList;
    }

    public void setFwarningList(List<FinancialWarning> fwarningList) {
        this.fwarningList = fwarningList;
    }

    public List<Prediction> getPredictionList() {
        return predictionList;
    }

    public void setPredictionList(List<Prediction> predictionList) {
        this.predictionList = predictionList;
    }
}
